<%@page import="com.yky.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="com.yky.entity.*"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String searchText = request.getParameter("searchText");
	if (null == searchText || "".equals(searchText)
			|| "null".equals(searchText)) {
		searchText = "请输入关键词";
	}
	String searchType = request.getParameter("searchType");
	searchType = (null == searchType ? "" : searchType);
	User aUser = (User) request.getSession().getAttribute("user");
	
	String provincename="";
	if(null!=aUser.getProvince()){
		provincename=aUser.getProvince().getName();
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<title>医学研究登记备案信息系统</title>
<meta http-equiv=X-UA-Compatible content=IE=EmulateIE7 />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script src="/js/common.js"></script>
<%@ include file="/commons/meta.jsp"%>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	var basePath = "<%=basePath%>";
	var searchText = "<%=searchText%>";
	var searchType ="<%=searchType%>";
	var provincename="<%=provincename%>";
</script>
<script type="text/javascript" src="/js/admin/user_list.js"></script>
</head>
<body>
	<div id="MainContainer">

		<jsp:include page="/index/project_top.jsp" />
		<input type="hidden" name="currentUsername" id="currentUsername" value="<%=request.getSession().getAttribute("username")%>">
		<div id="wrapWhite">
			<div
				style="margin-top: 10px; margin-left: 20px; color: #666; font-size: 12px;">当前位置：医学研究项目备案
				&gt;&gt; 用户查询</div>

			<div id="SearchLeft">
				<div class="searchnav">
					<div class="BoxTitle">
						<h2>所属省份</h2>
					</div>
					<div class="BoxContent">
						<ul class="list_3" id="proviceList">
							<li><%=provincename%></li>
						</ul>
					</div>
					<div class="BoxBottom">
						<div class="BoxBottomRight">&nbsp;</div>
					</div>
				</div>
			</div>
			<div id="SearchRight">
				<div style="margin-left: 20px;">
					用户名：<input type="text" name="searchText" id="searchText"
						style="width: 120px;" class="texbox" value=""
						onblur="if(!this.value){this.value='请输入名称';this.flag=undefined;}else{this.flag='true'};return true;"
						onfocus="if(this.value=='请输入名称'&&!this.flag)this.value='';return true;" />
					&nbsp;
					机构名称：<input type="text" name="orgname" id="orgname"
						style="width: 120px;" class="texbox" value=""
						onblur="if(!this.value){this.value='请输入机构名';this.flag=undefined;}else{this.flag='true'};return true;"
						onfocus="if(this.value=='请输入机构名'&&!this.flag)this.value='';return true;" />
					&nbsp;&nbsp;
					<button onclick="search();" class="btnMin" style="width: 150px;">搜索	Search</button>&nbsp;&nbsp;
					
				   <%
				  	 if(aUser.getRoleType()==2) {
				   	  // 机构管理员
				   %>
					<button id="adddelId" onclick="addUser();" class="btnMin" style="width: 100px;background: #EF8B0F;">新增用户</button>
					<%} %>
				</div>
				<div class="page" style="margin-top: 20px;">
					<div class="total">总计 <strong id="countTotal" name="countTotal">0</strong> 条记录</div>
					<div style="margin-top: 10px;">
							<button onclick="queryAll();" class="btnMin" style="width: 80px;">全部用户</button>&nbsp;&nbsp;
							 <%if(aUser.getRoleType()==0) { // 机构管理员%>
								<button onclick="queryType(1);" class="btnMin" style="width: 80px;">省级管理员</button>&nbsp;&nbsp;
								<button onclick="queryType(2);" class="btnMin" style="width: 80px;">机构管理员</button>&nbsp;&nbsp;
								<button onclick="queryType(3);" class="btnMin" style="width: 80px;">机构用户</button>&nbsp;&nbsp;
							<%}else if(aUser.getRoleType()==1){%>
								<button onclick="queryType(2);" class="btnMin" style="width: 80px;">机构管理员</button>&nbsp;&nbsp;
								<button onclick="queryType(3);" class="btnMin" style="width: 80px;">机构用户</button>&nbsp;&nbsp;
							<%}else if(aUser.getRoleType()==2){%>
								<button onclick="queryType(3);" class="btnMin" style="width: 80px;">机构用户</button>&nbsp;&nbsp;
							<%}%>
							<br/>
							是否为国家两委局批准的干细胞临床研究机构：
							<input onclick="lianghuiSelect(1);" type="button" class="btnMin" style="width: 100px;margin-top: 10px;" title="是" value="是" />&nbsp;&nbsp;
							<input onclick="lianghuiSelect(0);" type="button" class="btnMin" style="width: 100px;margin-top: 10px;" title="否" value="否" />&nbsp;&nbsp;<br/>
							是否为涉及人的生物医学研究机构:
							<input onclick="shejirenSelect(1);" class="btnMin" type="button" style="width: 100px;margin-top: 10px;" title="是" value="是" />&nbsp;&nbsp;
							<input onclick="shejirenSelect(0);" class="btnMin" type="button" style="width: 100px;margin-top: 10px;" title="否" value="否" />&nbsp;&nbsp;
	                </div>
				</div>
				<table id="dataArea" width="100%" border="0" cellspacing="0" cellpadding="0" class="table" style="margin-top: 10px;">
					<tr>
						<th scope="col"><input onclick="selectAllUser()" type="checkbox" id="selectAllUser"/></th>
						<th scope="col">用户名/真实姓名</th>
						<th scope="col">所属机构</th>
						<th scope="col">所属省份</th>
						<th scope="col">用户类型</th>
						<th scope="col">是否为国家两委局批准的干细胞临床研究机构</th>
						<th scope="col">是否为涉及人的生物医学研究机构</th>
						<th scope="col">操作</th>
					 </tr>
					<tr><td colspan="6">暂无信息</td></tr>
				</table>
				<div class="page">
					<div class="yellow pagination"></div>
				</div>

			</div>
		</div>

		<jsp:include page="/index/footer.jsp"></jsp:include>
	</div>
</body>
</html>
